<?php

namespace Acme\DemoBundle\DependencyInjection;

use Symfony\Component\HttpFoundation\Session\Session;

use Acme\DemoBundle\Entity\TUser;

class MyUser
{
    public function setUser(TUser $objUser, Session $session)
    {
        $session->set("user_id", $objUser->getId());
        $session->set("user_name", $objUser->getUserName());
        $session->set("user_type", $objUser->getMUserTypeId());
        $session->set("user_full_name", $objUser->getFullName());

        // form submitted
//         $host = "localhost";
//         $port = 1234;
//         // create socket
//         $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
//         // connect to server
//         $result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");

//         $session->set("socket", $socket);
    }
}
